import { Component, OnInit } from '@angular/core';
import { DragDrop } from '@angular/cdk/drag-drop';


@Component({
  selector: 'app-modal-dragdrop',
  templateUrl: './modal-dragdrop.component.html',
  styleUrls: ['./modal-dragdrop.component.css']
})
export class ModalDragdropComponent implements OnInit {

  isVisibleDragDrop = false;

  isVisible = false;

  constructor(private dragDrop: DragDrop) { }

  ngOnInit() {
  }

  setModelDragDrop(className: string) {
    const modal = document.getElementsByClassName(className)[0];
    const dragVideo = this.dragDrop.createDrag(modal as HTMLElement);
    const header = modal.querySelector('.ant-modal-header');
    dragVideo.withHandles([header as HTMLElement]);
    dragVideo.withBoundaryElement(document.body);
  }

}
